<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>主页</title>

<jsp:useBean id="testbean" scope="session" class="srt.Database" />
</head>
<body>
<%
String sql = "select * from TB_CustomersInfo";
ResultSet rs = testbean.exeSqlQuery(sql);
String Tci_idno =null;
String Tci_name=null;
String Tci_gender=null;
%>	
<table border="1">

	<tr>
	<th colspan="5"><a href="add.jsp">增加</a> <a href="showCustomerInfo.jsp">查询</a></th>
	</tr>
	<tr>
	<td >序号</td><td >会员编号</td><td >会员姓名</td><td>性别</td><td>操作</td>
	</tr>
<%
int i=0;
while (rs.next()) { 
	i++;
	Tci_idno = rs.getString("Tci_idno");	
	Tci_name = rs.getString("Tci_name"); 
	if(rs.getInt("Tci_gender")==0) {
		Tci_gender = ("女"); 
	}
	else {
		Tci_gender = ("男"); 
	}
out.println("<tr><td>"+i+"</td><td>"+Tci_idno+"</td><td>"+Tci_name+"</td><td>"+Tci_gender+"</td>"+
		"<td> <a href='modify.jsp?Tci_idno="+Tci_idno+"'>修改</a> "+
		"<a href='delete.jsp?Tci_idno="+Tci_idno+"'>删除</a></td></tr>"); 
}	
%>	
</table>
</body>
</html>